const development = {
  govCloud: 'https://govcloud-test.hzanchu.com',
  user: 'https://user-test.hzanchu.com',
  upload: 'https://user-test.hzanchu.com',
};

const test = {
  govCloud: 'https://govcloud-test.hzanchu.com',
  user: 'https://user-test.hzanchu.com',
  upload: 'https://user-test.hzanchu.com',
};

const pre = {
  govCloud: 'https://govcloud-test.hzanchu.com',
  user: 'https://user-test.hzanchu.com',
  upload: 'https://user-test.hzanchu.com',
};

const production = {
  govCloud: 'https://wsnb-sjdp.hzanchu.com',
  user: 'https://user.hzanchu.com',
  upload: 'https://users.hzanchu.com',
};

const createBaseUrl = (env) => {
  let baseUrl;
  switch (env) {
    case 'development': baseUrl = development; break;
    case 'test': baseUrl = test; break;
    case 'pre': baseUrl = pre; break;
    case 'production': baseUrl = production; break;
    default: baseUrl = development;
  }
  return baseUrl;
};

console.log('当前模式：', import.meta.env.MODE);

const baseUrl = createBaseUrl(import.meta.env.MODE);

// 测试接口
// const baseUrl = production // 线上接口
// const baseUrl = pre // 预发接口
export default baseUrl;
